﻿using Microsoft.AspNetCore.Mvc;
using 项目备忘录.Models;

namespace 项目备忘录.Controllers
{
    public class DeleteController : Controller
    {
        public IActionResult Index(int id)
        {
            Project? project = Project.projects.Find(item => item.id == id);
            if (project != null)
            {
                Project.projects.Remove(project);
            }
            return RedirectToAction("Index","Home");
        }
    }
}
